// perform quick algorithm on a given list of ints 

#include <iostream>
#include <vector>
using namespace std;

void swap(int& first, int& second)
{
  int tmp = first;
  first = second;
  second = tmp;
}

int partition(vector<int>& v, int low, int high)
{
  int pivot = v[high];

  int i = low - 1;

  for (int j = low; j <= high - 1; ++j) {
    if (v[j] <= pivot) {
      ++i;
      swap(v[i], v[j]);
    }
  }

  swap(v[i + 1], v[high]);

  return i + 1;
}

void quick_sort(vector<int>& v, int low, int high) {
  if (low < high) {
    int sorted_position = partition(v, low, high);

    quick_sort(v, low, sorted_position - 1);
    quick_sort(v, sorted_position + 1, high);
  }
}

int main()
{
  int no_of_elements;
  cin >> no_of_elements;
  vector<int> v(no_of_elements);

  for (int i = 0; i < no_of_elements; ++i) {
    cin >> v[i];
  }

  quick_sort(v, 0, no_of_elements - 1);

  for (int i = 0; i < no_of_elements; ++i) {
    cout << v[i] << ' ';
  }
  cout << endl;



  return 0;
}